<?php

/**
 * author : Tran Minh Toan
 */

class Zend_View_Helper_showTableWarranty{
    
    public function showTableWarranty($view){
        
        $arrWarranty = $view->arrWarranty;
        
        $strHtml = '';
        $strHtml .= '<table class="hovertable">';
        $strHtml .= '<tr>';
        $strHtml .= '<th>ID Khách hàng</th>';
        $strHtml .= '<th>ID Sản phẩm</th>';
        $strHtml .= '<th>Tình trạng trả hàng</th>';
        $strHtml .= '<th>Thao tác</th>';
        $strHtml .= '</tr>';
        
        if(isset ($arrWarranty)){
            foreach ($arrWarranty as $warranty) {
                $strHtml .= '<tr id="tablerow">';
                $strHtml .= '<td>'.$warranty->user_id_customer.'</td>';
                $strHtml .= '<td>'.$warranty->product_id.'</td>';
                $strHtml .= '<td>'.$warranty->isReturned.'</td>';
                $strHtml .= '<td><a class="icon-1" href="'.$view->baseUrl().'/warranty/edit/id/'.$warranty->warranty_id.'"/>
                                <a class="icon-5" href="'.$view->baseUrl().'/warranty/warrantydt/id/'.$warranty->warranty_id.'"/>
                             <a class="icon-2" href="'.$view->baseUrl().'/warranty/delete/id/'.$warranty->warranty_id.'"/></td>';
                $strHtml .= '</tr>';
            }
        }
        
        $strHtml .= '</table>';
        return $strHtml;
    }
}
?>

